#include "tools.h"
#include "tools.c"




int main(int argc, char* argv[]) {
    python_main();
    if (argc==2){
        //printf("%s",argv[1]);
        if ((strcmp(argv[1],"ru_RU")==0) || (strcmp(argv[1],"en_EN")==0)){
            print_all(argv[1]);
            menu();
        
        }
        
        else if (strcmp(argv[1],"-l")==0){
            printf("%d ", count_f);
        }
    }
    else if (argc==3){
        if ((strcmp(argv[1],"ru_RU")==0) || (strcmp(argv[1],"en_EN")==0)){
            if ((strcmp(argv[2],"-i")==0)){
                print_all(argv[1]);
                //menu();
                }
        }
        else if ((strcmp(argv[1],"-e")==0)){
                int index = 0;
                index = atoi(argv[2]);
                if ((index >= 0)  && (index<count_f)){
                    char *cmd_open = "kioclient exec ";
                    char *path_name = concat(path, dict_data[index].file_name);
                    execute(concat(cmd_open, path_name));
                }
            }
            else {
                int index = 0;
                index = atoi(argv[2]);
                if ((index >= 0)  && (index<count_f)){
                    if (strcmp(argv[1],"ru_RU")==0){
                        print_info_ru(index);
                    }
                    else {
                        print_info_en(index);
                    }
                }
        }   
    }
    freeStruct();
  return 0;
}
